Azure Integration Guide
This guide outlines the steps to integrate Azure Pipelines into your development workflow. Azure Pipelines is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate building, testing, and deploying your code.
Prerequisites
- An Azure DevOps account.
- The following tools installed on your Jenkins server:
- jq: A lightweight and flexible command-line JSON processor. You can install it by following the instructions at jq installation guide.
- curl: A command-line tool to transfer data to or from a server using various protocols. You can install it by following the instructions at curl download page.
Steps
Step 1: Setting Up a New Pipeline
- Open the Azure Devops Pipelines section.
- Click on New Pipeline.
- Click on Use the classic editor to create a pipeline without YAML.
- Select Azure Repos Git from the source options.
- Configure the project, repository, and branch.
- Start with an empty job template on template selection page.
Step 2: Configuring Pipeline Options
- Configure the agent pool and agent specification with available agent within agent job section.
- Create a pipeline variable named API_KEY with the following value:
sample_api_integration_key
Step 3: Handling the Execution Script
-
Download the execute.sh file and place it in the repository.
-
Replace the placeholder text PLACE_YOUR_CURL_COMMAND_HERE on line 71 of execute.sh with the following:
curl --location false/v2/apikeyexecution \ --header "Content-Type: application/json" \ --header "api-key: sample_api_integration_key" \ --data '{ "projectId": "PROJECT_ID", "organizationId": "ORGANIZATION_ID", "scenarioIds": ["SCENARIO_ID1", "SCENARIO_ID2"], "config": { "browser": { "id": "chrome", "label": "Chrome" }, "environmentId": "ENV_ID", "os": { "id": "ubuntu", "label": "Ubuntu" }, "resolution": { "id": "1", "label": "Ultra-Wide 4K (3840×2160)" } } }'
in execute.sh file on line no. 71.
-
Add a task named Bash from the Add Task(+) menu.
-
Configure the Bash task with the type set to File Path.
-
In the Script Path field, add the location of the execute.sh file, and add the argument
-t ${API_KEY}
. -
Add another task named Publish Test Results from the Add Task(+) menu.
-
Select the test result format as JUnit and set the test results file to result.xml.
Step 4: Finalizing Configuration
- Save the pipeline configuration.
- Click on Run pipeline to initiate the build process and publish the test results.